// // import { createStore } from 'redux';
// // const notices = ((state = { isReadAll: false, count: 8 }, action) => {
// //     switch (action.type) {
// //         case 'READ_ALL':
// //             return {...state, isReadAll: true }
// //         default:
// //             return state;
// //     }
// // })
// // const store = createStore(notices);
// // export default store;

// import { createStore } from 'redux';
// const notices = (state = { isReadAll: false }, action) => {
//         switch (action.type) {
//             case 'READ_ALL':
//                 return {...state, isReadAll: true }
//             default:
//                 return state;
//         }
//     }
//     //暴露这个store
// const store = createStore(notices);
// export default store;
//Redux 提供了一个combineReducers方法，用于 Reducer 的拆分
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import notices from './reducers/notices';
import products from './reducers/products';
import thunk from 'redux-thunk'
// import { combineReducers } from 'redux';
// const chatReducer = combineReducers({
//   chatLog,
//   statusMessage,
//   userName
// })
// export default todoApp;
//联合各个已拆分的reducer
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose
const enhancer = composeEnhancers(applyMiddleware(thunk))
const Reducer = combineReducers({
    notices,
    products
})
export const store = createStore(Reducer, compose(applyMiddleware(...[thunk])));